﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace OrderForm
{
    public partial class DeleteForm : Form
    {
        Order.OrderService service;
        public DeleteForm(Order.OrderService service)
        {
            InitializeComponent();
            this.service = service;
        }

        private void Delete_Click(object sender, EventArgs e)
        {
            try
            {
                service.DeleteOrder(ID.Text);
                Close();
            }
            catch
            {
                MessageBox.Show(this, "订单号不存在。", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
    }
}
